#include "widget.h"
#include "./ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    pb=new QPushButton(this);
    pb->setText("111");
    connect(pb,&QPushButton::clicked,this,&Widget::handleClick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{
    if(pb->text()==QString("111"))
    {
        pb->setText("222");
        pb->setGeometry(100,100,100,100);
    }else
    {
        pb->setText("111");
        pb->setGeometry(0,0,100,100);
    }
}
